package com.zj.core.ui

import android.graphics.Color
import android.os.Build
import android.support.annotation.RequiresApi
import android.view.View
import android.view.ViewGroup
import android.widget.LinearLayout
import com.zj.core.R
import org.jetbrains.anko.*

class VideoItemUi: AnkoComponent<ViewGroup> {
    @RequiresApi(Build.VERSION_CODES.M)
    override fun createView(ui: AnkoContext<ViewGroup>): View =with(ui){
        linearLayout{
            id= R.id.record_item_parent_view
            orientation=LinearLayout.VERTICAL
            //background=resources.getDrawable(R.drawable.bordle_line_detail_item)
            backgroundColor=resources.getColor(R.color.colorsWhite)
            lparams(width= matchParent,height = wrapContent)

            linearLayout{
                orientation=LinearLayout.HORIZONTAL
                setPadding(30,30,0,30)

                textView{
                    id= R.id.record_item_form_img
                }.lparams(width= wrapContent,height = wrapContent)

                textView{
                    textSize= 15F
                    textColor= Color.BLACK
                    id= R.id.record_item_form_value
                }.lparams(width=0,height = wrapContent){
                    weight=1F
                }
            }

            textView{
                backgroundColor=resources.getColor(R.color.colorsFrenchWhite)
            }.lparams(width= matchParent,height=dip(1))
        }
    }
}